<%@ page import = "java.util.ArrayList" import = "br.com.unieuro.dominio.Item" %>
<html>
<head>
	<title>Gerenciar Itens</title>
</head>
<%
ArrayList<Item> lista = (ArrayList<Item>)request.getSession().getAttribute("listaItens");
if(lista == null)
	lista = new ArrayList<Item>();
%>
<body>
<center>
<body background="/trabalho/jsp/fundo4.jpg" bgcolor="#00008B">
    <span style="font-family: 'Arial Black'; font-size: xx-large; font-weight: normal; font-style: normal; font-variant: small-caps; color: #CAE1FF;">Itens Cadastrados</span>
	<table border="1" title="Lista Itens">
			<tr>
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">ID</span>
				</td>
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">MATERIAL</span>
				</td>		
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">QTD</span>
				</td>	
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">VALOR</span>
				</td>
                <td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">DESCRICAO</span>
				</td>	
			</tr>			
			<% for(Item i : lista){ %>
			<tr>
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF"><%= i.getId()%></span>
				</td>
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF"><%= i.getNome() %></span>
				</td>
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF"><%= i.getQtd() %></span>
				</td>
				<td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF"><%= i.getValor() %></span>
				</td>
                <td align=center>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF"><%= i.getDescricao() %></span>
				</td>
			</tr>
			<%} %>
		</table>
		<br></br>
		<span style="font-family: 'Arial Black'; font-size: xx-large; font-weight: normal; font-style: normal; font-variant: small-caps; color: #CAE1FF;">Gerenciar Cadastro de Itens</span>
	<form action="/trabalho/editarExcluirItem" method="get">
		<table border="0">
			<tr>
				<td class="style2">
					<span style="color: #CAE1FF; font-style: normal; font-size: large; font-weight: bold">ID:</span>
				</td>
				<td>
					<input type="text" name="id" size= "2" style="width: 45px" />
				</td>
				</tr>
				<tr>
				<td class="style2">
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">MATERIAL:</span>
				</td>
				<td>
					<input type="text" name="material" />
				</td>
			</tr>
			<tr>
				<td class="style2">
					<span style="font-size: large; font-weight: bold; color:#CAE1FF">QUANTIDADE:</span>
				</td>
				<td>
					<input type="text" name="qtd"/>
				</td>
			</tr>
			<tr>
				<td class="style2">
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">VALOR:</span>
				</td>
				<td>
					<input type="text" name="valor"/>
				</td>
			</tr>
            <tr>
				<td>
					<span style="font-size: large; font-weight: bold; color: #CAE1FF">DESCRICAO:</span>
				</td>
				<td>
					<textarea name="descricao" rows="8" cols=""></textarea>
				</td>
			</tr>
			<tr>
				<td class="style3">
					<input type = "hidden" value="editarExcluirItem" name="pagina"/>
				</td>
				<td class="style1">
					<input type="submit" name= "gerenciar" value="Alterar" style="background-color: #43CD80" />&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="submit" name= "gerenciar" value="Excluir" style="background-color: #FF3030"  />&nbsp;&nbsp;&nbsp;&nbsp;
				</td>
				<td class="style1">
					<input type="reset" value="Limpar" style="background-color: #CAE1FF"/>&nbsp;&nbsp;&nbsp;&nbsp;
				</td>
			</tr>
		</table>
	</form>
    <a href="/trabalho/jsp/cadastro.jsp" style="font-size: small; color: #CAE1FF">Cadastrar Item</a>&nbsp;&nbsp;&nbsp;

        
        <a href="/trabalho/jsp/loginok.jsp" style="font-size: small; color: #CAE1FF">Principal</a>&nbsp;&nbsp;&nbsp;
        
</center>
</body>
</html>
